<%- include('../header.html')%>
<style>
    #listTBody td {
        vertical-align: middle;
    }

    #listTBody td img {
        width: 100px;
        height: 80px;
    }

    .btn.mini {
        margin-left: 5px;
    }

    .pagination ul > li {
        float: left;
    }

    #listTBody_detailGoods img {
        width: 100px;
        height: 100px;
    }

    #listTBody_detailGoods tr td, .table tr th, #order_list_tab tr td {
        text-align: center;
        vertical-align: middle;
    }

    #order_op_bar button {
        margin-right: 10px;
        float: right;
    }
</style>
<link href="/javascripts/utils/artDialog-master/css/ui-dialog.css" rel="stylesheet"/>

<div class="page-content">
    <div class="container-fluid">
        <div class="row-fluid">
            <div class="span12">
                <h3 class="page-title">
                </h3>
                <ul class="breadcrumb">
                    <li>
                        <i class="icon-home"></i>
                        <a id="mainModule">订单详情</a>
                        <i class="icon-angle-right"></i>
                    </li>
                </ul>
            </div>
        </div>

        <div id="dashboard">
            <div id="orderDetail_Modal" >

            </div>

        </div>
    </div>
</div>
</div>
<%- include('../footer.html')%>
<script type="text/javascript" src="../javascripts/utils/ejs.js"></script>
<script type="text/javascript" src="../javascripts/utils/layer/layer.js"></script>
<script type="text/javascript" src="../javascripts/utils/common.js"></script>
<script type="text/javascript" src="../javascripts/utils/summernote.js"></script>
<script type="text/javascript" src="../javascripts/utils/summernote-zh-CN.js"></script>
<script type="text/javascript" src="../javascripts/utils/pagingControl.js"></script>
<script type="text/javascript" src="../javascripts/config.js"></script>
<script type="text/javascript" src="/javascripts/utils/artDialog-master/dist/dialog-min.js"></script>
<script type="text/javascript" src="/javascripts/utils/artdialog.js"></script>
<script type="text/javascript" src="/javascripts/utils/taffydb/taffy-min.js"></script>


<script type="text/html" id="dev_orderInfo_template">
    <table class="table table-striped table-bordered table-advance table-hover"
           style="margin-top: 10px">
        <tbody>
        <tr>
            <td class="span2">会员名称：</td>
            <td>[%=detailInfo.MemberAccount%]</td>
        </tr>
        <tr>
            <td class="span2">交易流水号：</td>
            <td>[%=detailInfo.tradeCode%]</td>
        </tr>
        <tr>
            <td class="span2">订单编号：</td>
            <td>[%=orderInfo.OrderCode%]
                <button type="button" class="red" style="float: right"
                        onclick='return send_oos_msg("[%=detailInfo.Id%]","[%=orderInfo.OrderCode%]","[%=detailInfo.ConsigneeMobile%]")'>
                    订单缺货提醒
                </button>
            </td>
        </tr>
        <tr>
            <td class="span2">下单时间：</td>
            <td>[%=orderInfo.CreateTime.replace("T", " ").replace(".000Z", "")%]</td>
        </tr>
        <tr>
            <td class="span2">更新时间：</td>
            <td>[%=orderInfo.OrderTime.replace("T", " ").replace(".000Z", "")%]</td>
        </tr>
        <tr>
            <td class="span2">订单金额：</td>
            <td style="color: #CC0000;">￥[%=orderInfo.OrderTotalPrice%]</td>
        </tr>
        <tr>
            <td class="span2">商品总额：</td>
            <td style="color: #33AAAA">￥[%=orderInfo.GoodsTotalPrice%]</td>
        </tr>
        <tr>
            <td class="span2">订单状态：</td>
            <td style="color: green;">[%=orderInfo.OrderProgressInfo%]</td>
        </tr>
        <tr>
            <td class="span2">支付方式：</td>
            <td style="color: green;">[%=orderInfo.OrderPayInfo%]</td>
        </tr>
        <tr>
            <td class="span2">优惠券：</td>
            <td style="color: brown;">
                [%if(detailInfo.CouponPar){%]
                [%=detailInfo.CouponTitle%]
                [%}else{%]
                无使用优惠券
                [%}%]
            </td>
        </tr>
        <tr>
            <td class="span2">优惠金额：</td>
            <td style="color: brown;">
                [%if(detailInfo.CouponPar){%]
                ￥[%=detailInfo.CouponPar%]
                [%}else{%]
                ￥0
                [%}%]
            </td>
        </tr>
        <tr>
            <td class="span2">收件人：</td>
            <td>[%=detailInfo.ConsigneeName%]</td>
        </tr>
        <tr>
            <td class="span2">联系电话：</td>
            <td>[%=detailInfo.ConsigneeMobile%]</td>
        </tr>
        <tr>
            <td class="span2">收件地址：</td>
            <td>
                [%=detailInfo.Province%] [%=detailInfo.City%] [%=detailInfo.County%] [%=detailInfo.Address%]
                &nbsp;&nbsp;
                <div onclick='return editOrderConsigneeAddress("[%=detailInfo.Id%]")'
                     style='color: #ed9c28;display: inline-block;cursor: pointer;'>
                    <span><i class='icon-edit'></i>修改</span></div>
            </td>
        </tr>
        <tr>
            <td class="span2">订单备注：</td>
            <td style="color: orange">
                [%if(orderInfo.Remarks == null){%]
                [%}else{%]
                [%=orderInfo.Remarks%]
                [%}%]
            </td>
        </tr>
        <tr>
            <td class="span2">快递信息：</td>
            <td id="expressInfo" style="color: green; font-weight: normal;">
                [%for(var i=0;i
                <detailInfo.Express.length
                ;i++){%]
                <span style="border: 2px solid;border-radius: 25px !important;background-color: #dbdbdb;padding: 5px;">[%=detailInfo.Express[i].ExpressName%]:[%=detailInfo.Express[i].ExpressCode%]</span>
                [%}%]
                &nbsp;<i class='icon-plus' style='color: rgba(181, 44, 44, 0.86);display: inline-block;cursor: pointer;'
                         onclick='return addOrderExpress("[%=orderInfo.Id%]")'> 添加</i>

            </td>
        </tr>
        <tr>
            <td class="span2">分销信息：</td>
            <td style="color: #BD4418; font-weight: normal;">[%=detailInfo.Agent.agentUser%]</td>
        </tr>
        </tbody>
    </table>
    <table class="table table-striped table-bordered table-advance table-hover">
        <thead>
        <tr>
            <th style="width: 80px;">商品编号</th>
            <th style="width: 80px;">品牌</th>
            <th style="width: 90px;">商品图片</th>
            <th style="width: 180px;">商品名称</th>
            <th style="width: 60px;">商品金额</th>
            <th style="width: 40px;">件数</th>
            <th style="width: 80px;">商家信息</th>
            <th style="width: 150px;">操作</th>
            <th style="width: 80px;">物流</th>
        </tr>
        </thead>
        <tbody id="listTBody_detailGoods">
        [%for(var i=0;i
        <detailInfo.Goods.length
        ;i++){%]
        <tr>
            <td>[%=detailInfo.Goods[i].Skuid%]</td>
            <td>[%=detailInfo.Goods[i].BrandTitle%]</td>
            <td><img src="[%=detailInfo.Goods[i].GoodsImgPath%]"></td>
            <td>[%=detailInfo.Goods[i].GoodsTitle%]</td>
            <td>￥[%=detailInfo.Goods[i].GoodsSalePrice%]</td>
            <td>[%=detailInfo.Goods[i].GoodsNum%]</td>
            <td>
                <button onclick="oi.change.getMerchantInfo('[%=detailInfo.Goods[i].GoodsId%]')">
                    <i class="icon-bookmark">信息</i></button>
            </td>
            <td>
                [%if(orderInfo.OrderProgressState==2){%]
                <button onclick="oi.change.clickEvents('[%=orderInfo.OrderCode%]','[%=detailInfo.Goods[i].Skuid%]',
            '[%=detailInfo.Goods[i].GoodsNum%]','[%=detailInfo.Goods[i].GoodsSalePrice%]')">
                    <i class="icon-barcode">修改</i></button>
                <br/>
                [%}%]
                <a href="/service/add?oid=[%=orderInfo.OrderCode%]&gid=[%=detailInfo.Goods[i].Skuid%]&ggid=[%=detailInfo.Goods[i].GoodsGroupId%]"
                   class="btn mini blue btnOrdersDetail"><i class="icon-list-alt"></i> 售后</a>
            </td>
            [%if(detailInfo.Goods[i].ExpressCode){%]
            <td>[%=detailInfo.Goods[i].ExpressName%]：[%=detailInfo.Goods[i].ExpressCode%]</td>
            [%}else{%]
            <td>暂无</td>
            [%}%]
        </tr>
        [%}%]
        </tbody>
    </table>
</script>

<script type="text/html" id="dev_orderInfo_btns_template">
    <button type="button" class="btn" data-dismiss="modal">关闭</button>
    [%if(userRole!= "delivery"){%]
    [%if(status==1){%]
    <button type='button' class='btn yellow' onclick='return orderChangeConfirm("确定取消交易吗?",99,"[%=id%]")'>交易取消</button>
    [%}%]
    [%if(status==2){%]
    <button type='button' class='btn yellow' onclick='return orderChangeConfirm("确定要退款吗?",5,"[%=id%]")'>退款申请</button>
    <button type='button' class='btn blue' onclick='return orderChangeConfirm("确定订单有效吗?",3,"[%=id%]")'>确认订单</button>
    [%}%]
    [%if(status==3){%]
    <button type='button' class='btn yellow' onclick='return orderChangeConfirm("确定要退款吗?",5,"[%=id%]")'>退款申请</button>
    <button type='button' class='btn blue' onclick='return orderChangeConfirm("确定可以发货吗?",4,"[%=id%]")'>订单发货</button>
    [%}%]
    [%if(status==4){%]
    <button type='button' class='btn yellow' onclick='return orderChangeConfirm("确定要退款吗?",5,"[%=id%]")'>退款申请</button>
    <button type='button' class='btn red' onclick='return orderChangeConfirm("确定订单交易成功吗?",9,"[%=id%]")'>确认签收</button>
    [%}%]
    [%if(status==5){%]
    <button type='button' class='btn yellow' onclick='return orderChangeConfirm("确定已退款完成了吗?",19,"[%=id%]")'>完成退款
    </button>
    <button type='button' class='btn blue' onclick='return orderChangeConfirm("确定要取消退款吗?",2,"[%=id%]")'>取消退款申请</button>
    [%}%]
    [%}%]

</script>

<script type="text/html" id='dev_show_goods'>
    <div style="max-height: 400px;overflow-y: auto;width: 600px;">
        商品名称：[%=data[0].GoodsGroupTitle%]
        <table class="table table-striped table-bordered table-advance table-hover">
            <thead>
            <tr>
                <th>选择</th>
                <th>商品编号</th>
                <th>颜色</th>
                <th>尺码</th>
                <th>商品金额</th>
                <th>库存</th>
                <th>件数</th>
            </tr>
            </thead>
            <tbody>
            [%for(var i=0;i
            <data.length
            ;i++){%]
            <tr>
                <td>
                    [%if(price==data[i].GoodsSalePrice){%]
                    [%if(data[i].Id==oldGoodsId){%]
                    <span style="color:red">--</span>
                    [%}else{%]
                    <input type="radio" name="dev_radio" orderid="[%=orderId%]"
                           goodsid="[%=data[i].Id%]" oldgoodsid="[%=oldGoodsId%]"
                           goodsConfig="[%=data[i].FilterConfig%]"/>
                    [%}%]
                    [%}else{%]
                    --
                    [%}%]
                </td>
                <td>[%=data[i].Skuid%]</td>
                <td>[%=data[i].color%]</td>
                <td>[%=data[i].size%]</td>
                <td>￥[%=data[i].GoodsSalePrice%]</td>
                <td>[%=data[i].MaxCount%]</td>
                <td>[%=num%]</td>
            </tr>
            [%}%]
            </tbody>
        </table>
    </div>
</script>

<script type="text/javascript" src="../javascripts/order/orderDetail.js"></script>



